<?php

	require_once('../inc/fen_fns.php');
	sec_session_start_ajax();
	
	$did = $_GET['did'];
	
	
	if ($did != '0') {
		$did = "AND fen_members.faculty_id = '".$did."'";
	} else {
		$did = "";
	} 


?>	

	<div id="articles"></div>
						<table cellspacing="0" cellpadding="0" class="summaryTableMakale">
						<tr id="summaryTableMakaleRowTop">
							<td id="summaryTableMakaleTD1">&nbsp; Dergi Sınıf</td>
							<td>SCI</td>
							<td>SCIE</td>
							<td>SSCI</td>
							<td>AHCI</td>
							<td>Alan</td>
							<td>Diğer</td>
							<td bgcolor=ffeac9><font color="#555555">Toplam</font></td>
						</tr>
						<tr id="summaryTableMakaleRow1">
							<td id="summaryTableMakaleTD1">&nbsp; A Grubu</td>
<?php 

						$querystataa = $_DB->Query("SELECT IFNULL(SUM(indeks_turu = 'SCI'), 0) AS sci, IFNULL(SUM(indeks_turu = 'SCIE'),0) AS scie, IFNULL(SUM(indeks_turu = 'SSCI'),0) AS ssci, IFNULL(SUM(indeks_turu = 'AHCI'),0) AS ahci, IFNULL(SUM(indeks_turu = 'Alan'),0) AS alan, COUNT(indeks_turu) as total FROM fen_publications, fen_members WHERE fen_publications.yayin_tipi = 'Makale' and fen_publications.sinif = 'A' and fen_publications.member_id = fen_members.id ".$did);
						$querystatbb = $_DB->Query("SELECT IFNULL(SUM(indeks_turu = 'SCI'), 0) AS sci, IFNULL(SUM(indeks_turu = 'SCIE'),0) AS scie, IFNULL(SUM(indeks_turu = 'SSCI'),0) AS ssci, IFNULL(SUM(indeks_turu = 'AHCI'),0) AS ahci, IFNULL(SUM(indeks_turu = 'Alan'),0) AS alan, COUNT(indeks_turu) as total FROM fen_publications, fen_members WHERE fen_publications.yayin_tipi = 'Makale' and fen_publications.sinif = 'B' and fen_publications.member_id = fen_members.id ".$did);
						$querystatcc = $_DB->Query("SELECT IFNULL(SUM(indeks_turu = 'SCI'), 0) AS sci, IFNULL(SUM(indeks_turu = 'SCIE'),0) AS scie, IFNULL(SUM(indeks_turu = 'SSCI'),0) AS ssci, IFNULL(SUM(indeks_turu = 'AHCI'),0) AS ahci, IFNULL(SUM(indeks_turu = 'Alan'),0) AS alan, COUNT(indeks_turu) as total FROM fen_publications, fen_members WHERE fen_publications.yayin_tipi = 'Makale' and fen_publications.sinif = 'C' and fen_publications.member_id = fen_members.id ".$did);
						$querystatdd = $_DB->Query("SELECT IFNULL(SUM(indeks_turu = 'SCI'), 0) AS sci, IFNULL(SUM(indeks_turu = 'SCIE'),0) AS scie, IFNULL(SUM(indeks_turu = 'SSCI'),0) AS ssci, IFNULL(SUM(indeks_turu = 'AHCI'),0) AS ahci, IFNULL(SUM(indeks_turu = 'Alan'),0) AS alan, COUNT(indeks_turu) as total FROM fen_publications, fen_members WHERE fen_publications.yayin_tipi = 'Makale' and fen_publications.sinif = 'D' and fen_publications.member_id = fen_members.id ".$did);
						$querystatdiger = $_DB->Query("SELECT IFNULL(SUM(indeks_turu = 'SCI'), 0) AS sci, IFNULL(SUM(indeks_turu = 'SCIE'),0) AS scie, IFNULL(SUM(indeks_turu = 'SSCI'),0) AS ssci, IFNULL(SUM(indeks_turu = 'AHCI'),0) AS ahci, IFNULL(SUM(indeks_turu = 'Alan'),0) AS alan, IFNULL(SUM(length(indeks_turu) < 1),0) AS diger, COUNT(indeks_turu) as total FROM fen_publications, fen_members WHERE fen_publications.yayin_tipi = 'Makale' and length(fen_publications.sinif) = 0 and fen_publications.member_id = fen_members.id ".$did);
						
?>							
							<td><?php echo $_DB->GetResultValue($querystataa, "0", "sci"); ?></td>
							<td><?php echo $_DB->GetResultValue($querystataa, "0", "scie"); ?></td>
							<td><?php echo $_DB->GetResultValue($querystataa, "0", "ssci"); ?></td>
							<td><?php echo $_DB->GetResultValue($querystataa, "0", "ahci"); ?></td>
							<td><?php echo $_DB->GetResultValue($querystataa, "0", "alan"); ?></td>
							<td>-</td>
							<td id="summaryTableMakaleTD2"><?php echo $_DB->GetResultValue($querystataa, "0", "total"); ?></td>
						</tr>
						<tr id="summaryTableMakaleRow2">
							<td id="summaryTableMakaleTD1">&nbsp; B Grubu</td>
							<td><?php echo $_DB->GetResultValue($querystatbb, "0", "sci"); ?></td>
							<td><?php echo $_DB->GetResultValue($querystatbb, "0", "scie"); ?></td>
							<td><?php echo $_DB->GetResultValue($querystatbb, "0", "ssci"); ?></td>
							<td><?php echo $_DB->GetResultValue($querystatbb, "0", "ahci"); ?></td>
							<td><?php echo $_DB->GetResultValue($querystatbb, "0", "alan"); ?></td>
							<td>-</td>
							<td id="summaryTableMakaleTD2b"><?php echo $_DB->GetResultValue($querystatbb, "0", "total"); ?></td>
						</tr>
						<tr id="summaryTableMakaleRow1">
							<td id="summaryTableMakaleTD1">&nbsp; C Grubu</td>
							<td><?php echo $_DB->GetResultValue($querystatcc, "0", "sci"); ?></td>
							<td><?php echo $_DB->GetResultValue($querystatcc, "0", "scie"); ?></td>
							<td><?php echo $_DB->GetResultValue($querystatcc, "0", "ssci"); ?></td>
							<td><?php echo $_DB->GetResultValue($querystatcc, "0", "ahci"); ?></td>
							<td><?php echo $_DB->GetResultValue($querystatcc, "0", "alan"); ?></td>
							<td>-</td>
							<td id="summaryTableMakaleTD2"><?php echo $_DB->GetResultValue($querystatcc, "0", "total"); ?></td>
						</tr>
						<tr id="summaryTableMakaleRow2">
							<td id="summaryTableMakaleTD1">&nbsp; D Grubu</td>
							<td><?php echo $_DB->GetResultValue($querystatdd, "0", "sci"); ?></td>
							<td><?php echo $_DB->GetResultValue($querystatdd, "0", "scie"); ?></td>
							<td><?php echo $_DB->GetResultValue($querystatdd, "0", "ssci"); ?></td>
							<td><?php echo $_DB->GetResultValue($querystatdd, "0", "ahci"); ?></td>
							<td><?php echo $_DB->GetResultValue($querystatdd, "0", "alan"); ?></td>
							<td>-</td>
							<td id="summaryTableMakaleTD2b"><?php echo $_DB->GetResultValue($querystatdd, "0", "total"); ?></td>
						</tr>
						<tr id="summaryTableMakaleRow1">
							<td id="summaryTableMakaleTD1">&nbsp; Diğer</td>
							<td><?php echo $_DB->GetResultValue($querystatdiger, "0", "sci"); ?></td>
							<td><?php echo $_DB->GetResultValue($querystatdiger, "0", "scie"); ?></td>
							<td><?php echo $_DB->GetResultValue($querystatdiger, "0", "ssci"); ?></td>
							<td><?php echo $_DB->GetResultValue($querystatdiger, "0", "ahci"); ?></td>
							<td><?php echo $_DB->GetResultValue($querystatdiger, "0", "alan"); ?></td>
							<td><?php echo $_DB->GetResultValue($querystatdiger, "0", "diger"); ?></td>
							<td id="summaryTableMakaleTD2"><?php echo $_DB->GetResultValue($querystatdiger, "0", "total"); ?></td>
						</tr>
					</table>